<template>
  <div class="box2">
    <template v-if="to">
      <router-link :to="to">
        <slot></slot>
      </router-link>
      <span>{{ separator }}</span>
    </template>
    <template v-else>
      <slot></slot>
      <span> {{ separator }}</span>
    </template>
  </div>
</template>
<script>

export default {

  name: 'BreadcrumbItem',
  inject: ['separator'],
  data () {
    return {

    }
  },
  props: {
    to: [String, Array]
  },
  created () {
  },
  computed: {
  },
  methods: {
  }
}
</script>
<style lang='less'  scoped>
.box2 {
  margin: 0 10px;
  span {
    margin: 0 5px;
  }

  &:last-child {
    span {
      display: none;
    }
  }
}
</style>
